package date;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class Demo1 {
    public static void main(String[] args) {
//            int year = 2019;
//            int month = 11;
//            Calendar cal = Calendar.getInstance();//获取一个Calendar对象
////            cal.setTime(new Date());
////            cal.add(Calendar.MONTH, -1);//获取当前时间上一个月
//            cal.set(Calendar.YEAR,year);
//            cal.set(Calendar.MONTH,month-1);
////                    cal.add(Calendar.MONTH, -1);//获取当前时间上一个月
//
//            SimpleDateFormat s = new SimpleDateFormat("yyyy-MM");
//            String date =  s.format(cal.getTime());
//            System.out.println(date);
//            int first = cal.getActualMinimum(cal.DAY_OF_MONTH);//获取本月最小天数
//            int last = cal.getActualMaximum(cal.DAY_OF_MONTH);//获取本月最大天数
//            System.out.println(first);
//            System.out.println(last);
//            cal.set(Calendar.DATE, 3);
//            int firstDay = cal.get(Calendar.DAY_OF_WEEK); //获取本周的第几天
//            System.out.println(firstDay);
//            System.out.println(isEmpty(null));
//        System.out.println("李博飞");
//        for(int i = 0; i<=10 ;i++){
//            list.add(i);
//        }
//        System.out.println(list);
//        System.out.println(list.get(7));
        Calendar cl = Calendar.getInstance();
        cl.setTime(new Date());
        cl.add(Calendar.MONTH, 1);//这里就是月份的相加
        Date date = cl.getTime();//获取到相加后的时间
        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(s.format(date));
        
    }

    public static Boolean isEmpty(String str){
            return  null==str || str.trim().length()==0;
    }
}
